﻿using System;
using NetFrame;

namespace Study02_测试引用NET包.logic
{
    /// <summary>
    /// 消息分发执行中心
    /// </summary>
    public class HandlerCenter : NetFrame.ABS.AbsHandlerCenter
    {


        ////构造方法
        //public HandlerCenter()
        //{

        //}

        ///// <summary>
        ///// 封装接口——断开连接
        ///// </summary>
        ///// <param name="token"></param>
        ///// <param name="error"></param>

        //public override void ClientClose(UserToken token, string error)
        //{
        //    //UserToken用户信息实体类
        //    Console.WriteLine("有客户断开连接"+token.conn.RemoteEndPoint);
        //    throw new NotImplementedException();
        //}
        ///// <summary>
        /////  封装接口——打开连接
        ///// </summary>
        ///// <param name="token"></param>
        //public override void ClientConnect(UserToken token)
        //{
        //    //UserToken用户信息实体类
        //    Console.WriteLine("有客户开始连接" + token.conn.RemoteEndPoint);
        //    throw new NotImplementedException();
        //}
        ///// <summary>
        /////  封装接口——消息到达
        ///// </summary>
        ///// <param name="token"></param>
        ///// <param name="message"></param>
        //public override void MessageReceive(UserToken token, object message)
        //{
        //    //UserToken用户信息实体类
        //    Console.WriteLine("有客户发送消息" + token.conn.RemoteEndPoint);
        //    throw new NotImplementedException();
        //}
        public override void ClientClose(UserToken token, string error)
        {
            Console.WriteLine("有客户close消息" + token.Connecting.RemoteEndPoint);
            //throw new NotImplementedException();
        }

        public override void ClientConnect(UserToken token)
        {
            Console.WriteLine("有客户conn消息" + token.Connecting.RemoteEndPoint);
           // throw new NotImplementedException();
        }

        public override void MessageRecive(UserToken token, object message)
        {
            //UserToken用户信息实体类
            Console.WriteLine("有客户发送消息" + token.Connecting.RemoteEndPoint);
           // throw new NotImplementedException();
        }
    }
}
